import request from "@/utils/requestUtils";
import {getApiUrl} from "@/api/apiUrl";

let url_pre = getApiUrl()

export function nowConfigInfo() {
	let url = url_pre + '/config/nowConfig'
	return request({
		url: url,
		method: 'get',
		headers: {
			// 请求头
		}
	})
}

export function configInfoList(uid) {
	let url = url_pre + '/strategys/view?uid=' + uid
	return request({
		url: url,
		method: 'get',
		headers: {

		}
	})
}

export function changeConfig(option) {
	let url = url_pre + '/strategys/view'
	return request({
		url: url,
		method: 'post',
		data: option,
		headers: {

		}
	})
}
// 开启配置
export function startConfig(sid) {
	let url = url_pre + '/strategys/view/start?sid=' + sid
	return request({
		url: url,
		method: 'get',
	})
}
// 删除配置
export function removeConfig(sid) {
	let url = url_pre + '/strategys/view/remove?sid=' + sid
	return request({
		url: url,
		method: 'get',
	})
}

export function captureRecord(date){
	let url = url_pre + '/capture/record?date=' + date
	return request({
		url: url,
		method: 'get',
		headers: {

		}
	})
}

// 数据展示获取
export function dataDisplay(uid){
	let url = url_pre + '/data/normal?uid=' + uid
	return request({
		url: url,
		method: 'get',
		headers: {

		}
	})
}

// 警报数据
export function dataAlarm(uid){
	let url = url_pre + '/data/alarm?uid=' + uid
	return request({
		url: url,
		method: 'get',
		headers: {

		}
	})
}

// 抓拍接口
export function photoView(uid,startTime,endTime){
	let url = url_pre + '/photos/view?uid=' + uid + '&start_datetime=' + startTime + '&end_datetime=' + endTime
	return request({
		url: url,
		method: 'get',
		headers: {

		}
	})
}
